package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.ImageIcon;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.ArrayList;

import javax.swing.JLabel;

import controllers.ClientController;


public class WMap extends JFrame {
	ClientController clientCon;
	String Place;
	static String ID;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					WMap frame = new WMap(ID);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public WMap(String id) {
		this.ID=id;
		setTitle("World Map");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 629, 365);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnNewButton = new JButton("");
		btnNewButton.setToolTipText("NorthAmerica");
		btnNewButton.setOpaque(false);
		btnNewButton.setContentAreaFilled(false);
		btnNewButton.setBorderPainted(true);
		btnNewButton.setIcon(null);
		btnNewButton.setBounds(0, 0, 161, 74);
		contentPane.add(btnNewButton);
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Place="NorthAmerica";
				ShowCatalog frame = new ShowCatalog(Place,ID);
				frame.setVisible(true);
				dispose();
			}
		});
		
		
		JButton btnNewButton_1 = new JButton("");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Place="LatinAmerica";
				ShowCatalog frame = new ShowCatalog(Place,ID);
				frame.setVisible(true);
				dispose();
			}
		});
		btnNewButton_1.setToolTipText("LatinAmerica");
		btnNewButton_1.setBounds(0, 75, 208, 252);
		btnNewButton_1.setOpaque(false);
		btnNewButton_1.setContentAreaFilled(false);
		btnNewButton_1.setBorderPainted(false);
		contentPane.add(btnNewButton_1);
		
		JButton btnNewButton_2 = new JButton("  ");
		btnNewButton_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Place="Europe";	
				ShowCatalog frame = new ShowCatalog(Place,ID);
				frame.setVisible(true);
				dispose();
			}
		});
		btnNewButton_2.setToolTipText("Europe");
		btnNewButton_2.setIcon(null);
		btnNewButton_2.setBounds(161, 0, 192, 74);
		btnNewButton_2.setOpaque(false);
		btnNewButton_2.setContentAreaFilled(false);
		btnNewButton_2.setBorderPainted(false);
		contentPane.add(btnNewButton_2);
		
		JButton btnNewButton_3 = new JButton(" ");
		btnNewButton_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Place="Africa";
				ShowCatalog frame = new ShowCatalog(Place,ID);
				frame.setVisible(true);
				dispose();
			}
		});
		btnNewButton_3.setToolTipText("Africa");
		btnNewButton_3.setBounds(206, 75, 147, 252);
		btnNewButton_3.setOpaque(false);
		btnNewButton_3.setContentAreaFilled(false);
		btnNewButton_3.setBorderPainted(false);
		contentPane.add(btnNewButton_3);
		
		JButton btnNewButton_4 = new JButton(" ");
		btnNewButton_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Place="Asia";
				
				ShowCatalog frame = new ShowCatalog(Place,ID);
				frame.setVisible(true);
				dispose();
			}
		});
		
		btnNewButton_4.setToolTipText("Asia");
		btnNewButton_4.setBounds(352, 0, 261, 153);
		btnNewButton_4.setOpaque(false);
		btnNewButton_4.setContentAreaFilled(false);
		btnNewButton_4.setBorderPainted(false);
		contentPane.add(btnNewButton_4);
		
		JButton btnNewButton_5 = new JButton("");
		btnNewButton_5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Place="Oceania";
			
				ShowCatalog frame = new ShowCatalog(Place,ID);
				frame.setVisible(true);
				dispose();
			}
		});
		btnNewButton_5.setToolTipText("Oceania");
		btnNewButton_5.setBounds(352, 152, 261, 175);
		btnNewButton_5.setOpaque(false);
		btnNewButton_5.setContentAreaFilled(false);
		btnNewButton_5.setBorderPainted(false);
		contentPane.add(btnNewButton_5);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setIcon(new ImageIcon("images//World.jpg"));
		lblNewLabel.setBounds(0, 0, 629, 327);
		contentPane.add(lblNewLabel);
		contentPane.setLayout(null);
	}
	
	
	}

